home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / docs / misc / amiodbc.lha / DBASE.TXT < prev    next >
Encoding:
Text File  |  1997-05-09  |  6.5 KB  |  147 lines

  1. ----------------------------------------------------------------------------
  2. Genaral Format of .dbf files in Xbase languages                    18-Nov-96
  3. ----------------------------------------------------------------------------
  4. Applies for / supported by:
  5.  
  6.    FS = FlagShip       D3 = dBaseIII+
  7.    Fb = FoxBase        D4 = dBaseIV
  8.    Fp = FoxPro         D5 = dBaseV
  9.    CL = Clipper
  10.  
  11.  
  12. 1. DBF Structure
  13. ================
  14.  
  15. Byte   Description
  16. ------+--------------------------------------
  17. 0..n   .dbf header (see 2 for size, byte 8)
  18. n+1    1st record of fixed length (see 2&3)  \
  19.        2nd record (see 2 for size, byte 10)  \ if dbf is
  20.        ...                                   / not empty
  21.        last record                           /
  22. last   optional: 0x1a (eof byte)
  23.  
  24.  
  25. 2. DBF Header (variable size, depending on field count)
  26. =======================================================
  27.  
  28. Byte Size Contents Description                  Applies for (supported by)
  29. ----+----+--------+----------------------------+-----------------------------
  30. 00     1   0x03    plain .dbf                   FS, D3, D4, D5, Fb, Fp, CL
  31.            0x04    plain .dbf                   D4, D5  (FS)
  32.            0x05    plain .dbf                   D5, Fp  (FS)
  33.            0x43    with  .dbv memo var size     FS
  34.            0xB3    with  .dbv and .dbt memo     FS
  35.            0x83    with  .dbt memo              FS, D3, D4, D5, Fb, Fp, CL
  36.            0x8B    with  .dbt memo in D4 format D4, D5
  37.            0x8E    with  SQL table              D4, D5
  38.            0xF5    with  .fmp memo              Fp
  39. 01     3  YYMMDD   Last update digits           all
  40. 04     4  ulong    Number of records in file    all
  41. 08     2  ushort   Header size in bytes         all
  42. 10     2  ushort   Record size in bytes         all
  43. 12     2   0,0     Reserved                     all
  44. 14     1   0x01    Begin transaction            D4, D5
  45.            0x00    End Transaction              D4, D5
  46.            0x00    ignored                      FS, D3, Fb, Fp, CL
  47. 15     1   0x01    Encryptpted                  D4, D5
  48.            0x00    normal visible               all
  49. 16    12   0 (1)   multi-user environment use   D4,D5
  50. 28     1   0x01    production index exists      Fp, D4, D5
  51.            0x00    index upon demand            all
  52. 29     1   n       language driver ID           D4, D5
  53.            0x01    codepage  437 DOS USA        Fp
  54.            0x02    codepage  850 DOS Multi ling Fp
  55.            0x03    codepage 1251 Windows ANSI   Fp
  56.            0xC8    codepage 1250 Windows EE     Fp
  57.            0x00    ignored                      FS, D3, Fb, Fp, CL
  58. 30     2   0,0     reserved                     all
  59. 32    n*32         Field Descriptor, see (2a)   all
  60. +1     1   0x0D    Header Record Terminator     all
  61.  
  62.  
  63. 2a. Field descriptor array in dbf header (fix 32 bytes for each field)
  64. ========================================
  65.  
  66. Byte Size Contents Description                  Applies for (supported by)
  67. ----+----+--------+----------------------------+-----------------------------
  68. 0     11   ASCI    field name, 0x00 termin.     all
  69. 11     1   ASCI    field type  (see 2b)         all
  70. 12     4   n,n,n,n fld address in memory        D3
  71.            n,n,0,0 offset from record begin     Fp
  72.            0,0,0,0 ignored                      FS, D4, D5, Fb, CL
  73. 16     1   byte    Field length, bin (see 2b)   all \ FS,CL: for C field type,
  74. 17     1   byte    decimal count, bin           all / both used for fld lng
  75. 18     2   0,0     reserved                     all
  76. 20     1   byte    Work area ID                 D4, D5
  77.            0x00    unused                       FS, D3, Fb, Fp, CL
  78. 21     2   n,n     multi-user dBase             D3, D4, D5
  79.            0,0     ignored                      FS, Fb, Fp, CL
  80. 23     1   0x01    Set Fields                   D3, D4, D5
  81.            0x00    ignored                      FS, Fb, Fp, CL
  82. 24     7   0..0    reserved                     all
  83. 31     1   0x01    Field is in .mdx index       D4, D5
  84.            0x00    ignored                      FS, D3, Fb, Fp, CL
  85.  
  86.  
  87. 2b. Field type and size in dbf header, field descriptor (1 byte)
  88. =======================================================
  89.  
  90.   Size Type      Description/Storage            Applies for (supported by)
  91. ------+---------+------------------------------+-----------------------------
  92. C 1..n Char      ASCII (OEM code page chars)    all
  93.                  rest= space, not \0 term.
  94.                  n = 1..64kb (using deci count) FS
  95.                  n = 1..32kb (using deci count) Fp, CL
  96.                  n = 1..254                     all
  97. D 8    Date      8 Ascii digits (0..9) in the   all
  98.                  YYYYMMDD format
  99. F 1..n Numeric   Ascii digits (-.0123456789)    FS, D4, D5, Fp
  100.                  variable pos. of float.point
  101.                  n = 1..20
  102. N 1..n Numeric   Ascii digits (-.0123456789)    all
  103.                  fix posit/no float.point
  104.                  n = 1..20                      FS, Fp, CL
  105.                  n = 1..18                      D3, D4, D5, Fb
  106. L 1    Logical   Ascii chars (YyNnTtFf space)   FS, D3, Fb, Fp, CL
  107.                  Ascii chars (YyNnTtFf ?)       D4, D5  (FS)
  108. M 10   Memo      10 digits repres. the start    all
  109.                  block posit. in .dbt file, or
  110.                  10spaces if no entry in memo
  111. V 10   Variable  Variable, bin/asc data in .dbv FS
  112.                  4bytes bin= start pos in memo
  113.                  4bytes bin= block size
  114.                  1byte     = subtype
  115.                  1byte     = reserved (0x1a)
  116.                  10spaces if no entry in .dbv
  117. P 10   Picture   binary data in .ftp            Fp
  118.                  structure like M
  119. B 10   Binary    binary data in .dbt            D5
  120.                  structure like M
  121. G 10   General   OLE objects                    D5, Fp
  122.                  structure like M
  123. 2 2    short int binary int max +/- 32767       FS
  124. 4 4    long int  binary int max +/- 2147483647  FS
  125. 8 8    double    binary signed double IEEE      FS
  126.  
  127.  
  128. 3. Each Dbf record (fix length)
  129. ==================
  130.  
  131. Byte   Size  Description                           Applies for (supported by)
  132. ------+----+--------------------------------------+--------------------------
  133. 0      1    deleted flag "*" or not deleted " "     all
  134. 1..n   1..  x-times contents of fields, fixed       all
  135.             length, unterminated.
  136.             For n, see (2) byte 10..11
  137.  
  138.  
  139. ---
  140. multisoft Datentechnik GmbH
  141.  
  142. Phone  (+49-89) 649-0040    Fax (+49-89) 641-2974
  143. E-mail support@fship.com    WWW http://www.fship.com
  144. .
  145.  
  146.  
  147.